# -*- coding: utf-8 -*-

from google.appengine.ext import db

class Usuario(db.Model):
    email = db.EmailProperty(required=True)
    senha = db.StringProperty(required=True)
    
    @staticmethod
    def exists(email):
        '''
        Checa se existe algum usuário cadastrado com o email passado
        '''
        query = Usuario.all(keys_only=True).filter('email', email)
        user = query.get()
        
        if user:
            return True
        
        return False